home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / FILER / GZIP1_2_.SPK / src_zip_gz / src / zip / h / tailor < prev   
Text File  |  1993-07-28  |  7KB  |  309 lines

  1. /* tailor.h -- target dependent definitions
  2.  * Copyright (C) 1992-1993 Jean-loup Gailly.
  3.  * This is free software; you can redistribute it and/or modify it under the
  4.  * terms of the GNU General Public License, see the file COPYING.
  5.  */
  6.  
  7. /* The target dependent definitions should be defined here only.
  8.  * The target dependent functions should be defined in tailor.c.
  9.  */
  10.  
  11. /* $Id: tailor.h,v 0.18 1993/06/14 19:32:20 jloup Exp $ */
  12.  
  13. #if defined(__MSDOS__) && !defined(MSDOS)
  14. #  define MSDOS
  15. #endif
  16.  
  17. #if defined(__OS2__) && !defined(OS2)
  18. #  define OS2
  19. #endif
  20.  
  21. #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
  22. #  undef MSDOS
  23. #endif
  24.  
  25. #ifdef MSDOS
  26. #  ifdef __GNUC__
  27.      /* DJGPP version 1.09+ on MS-DOS.
  28.       * The DJGPP 1.09 stat() function must be upgraded before gzip will
  29.       * fully work.
  30.       * No need for DIRENT, since <unistd.h> defines POSIX_SOURCE which
  31.       * implies DIRENT.
  32.       */
  33. #    define near
  34. #  else
  35. #    define MAXSEG_64K
  36. #    ifdef __TURBOC__
  37. #      define NO_UTIME
  38. #      define NO_OFF_T
  39. #    else /* MSC */
  40. #      define HAVE_SYS_UTIME_H
  41. #      define NO_UTIME_H
  42. #    endif
  43. #  endif
  44. #  define PATH_SEP2 '\\'
  45. #  define PATH_SEP3 ':'
  46. #  define MAX_PATH_LEN  128
  47. #  define NO_MULTIPLE_DOTS
  48. #  define MAX_EXT_CHARS 3
  49. #  define Z_SUFFIX "z"
  50. #  define NO_CHOWN
  51. #  define PROTO
  52. #  define STDC_HEADERS
  53. #  define NO_SIZE_CHECK
  54. #  define casemap(c) tolow(c) /* Force file names to lower case */
  55. #  include <io.h>
  56. #  define OS_CODE  0x00
  57. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  58. #  if !defined(NO_ASM) && !defined(ASMV)
  59. #    define ASMV
  60. #  endif
  61. #else
  62. #  define near
  63. #endif
  64.  
  65. #ifdef OS2
  66. #  define PATH_SEP2 '\\'
  67. #  define PATH_SEP3 ':'
  68. #  define MAX_PATH_LEN  260
  69. #  ifdef OS2FAT
  70. #    define NO_MULTIPLE_DOTS
  71. #    define MAX_EXT_CHARS 3
  72. #    define Z_SUFFIX "z"
  73. #  endif
  74. #  define NO_CHOWN
  75. #  define PROTO
  76. #  define STDC_HEADERS
  77. #  define casemap(c) tolow(c)
  78. #  include <io.h>
  79. #  define OS_CODE  0x06
  80. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  81. #  ifdef _MSC_VER
  82. #    define HAVE_SYS_UTIME_H
  83. #    define NO_UTIME_H
  84. #    define MAXSEG_64K
  85. #    undef near
  86. #    define near _near
  87. #  endif
  88. #  ifdef __EMX__
  89. #    define HAVE_SYS_UTIME_H
  90. #    define NO_UTIME_H
  91. #    define DIRENT
  92. #    define EXPAND(argc,argv) \
  93.        {_response(&argc, &argv); _wildcard(&argc, &argv);}
  94. #  endif
  95. #  ifdef __BORLANDC__
  96. #    define DIRENT
  97. #  endif
  98. #  ifdef __ZTC__
  99. #    define NO_DIR
  100. #    define NO_UTIME_H
  101. #    include <dos.h>
  102. #    define EXPAND(argc,argv) \
  103.        {response_expand(&argc, &argv);}
  104. #  endif
  105. #endif
  106.  
  107. #ifdef MSDOS
  108. #  ifdef __TURBOC__
  109. #    include <alloc.h>
  110. #    define DYN_ALLOC
  111.      /* Turbo C 2.0 does not accept static allocations of large arrays */
  112.      void * fcalloc (unsigned items, unsigned size);
  113.      void fcfree (void *ptr);
  114. #  else /* MSC */
  115. #    include <malloc.h>
  116. #    define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
  117. #    define fcfree(ptr) hfree(ptr)
  118. #  endif
  119. #else
  120. #  ifdef MAXSEG_64K
  121. #    define fcalloc(items,size) calloc((items),(size))
  122. #  else
  123. #    define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
  124. #  endif
  125. #  define fcfree(ptr) free(ptr)
  126. #endif
  127.  
  128. #if defined(VAXC) || defined(VMS)
  129. #  define PATH_SEP ']'
  130. #  define PATH_SEP2 ':'
  131. #  define SUFFIX_SEP ';'
  132. #  define NO_MULTIPLE_DOTS
  133. #  define Z_SUFFIX "-gz"
  134. #  define RECORD_IO 1
  135. #  define casemap(c) tolow(c)
  136. #  define OS_CODE  0x02
  137. #  define OPTIONS_VAR "GZIP_OPT"
  138. #  define STDC_HEADERS
  139. #  define NO_UTIME
  140. #  define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
  141. #  include <file.h>
  142. #  define unlink delete
  143. #  ifdef VAXC
  144. #    define NO_FCNTL_H
  145. #    include <unixio.h>
  146. #  endif
  147. #endif
  148.  
  149. #ifdef AMIGA
  150. #  define PATH_SEP2 ':'
  151. #  define STDC_HEADERS
  152. #  define casemap(c) tolow(c) /* Force file names to lower case */
  153. #  define OS_CODE  0x01
  154. #  define ASMV
  155. #  ifdef __GNUC__
  156. #    define DIRENT
  157. #    define HAVE_UNISTD_H
  158. #  else /* SASC */
  159. #    define NO_STDIN_FSTAT
  160. #    define SYSDIR
  161. #    define NO_SYMLINK
  162. #    define NO_CHOWN
  163. #    define NO_FCNTL_H
  164. #    include <fcntl.h> /* for read() and write() */
  165. #    define direct dirent
  166.      extern void _expand_args(int *argc, char ***argv);
  167. #    define EXPAND(argc,argv) _expand_args(&argc,&argv);
  168. #    undef  O_BINARY /* disable useless --ascii option */
  169. #  endif
  170. #endif
  171.  
  172. #if defined(ATARI) || defined(atarist)
  173. #  ifndef STDC_HEADERS
  174. #    define STDC_HEADERS
  175. #    define HAVE_UNISTD_H
  176. #    define DIRENT
  177. #  endif
  178. #  define ASMV
  179. #  define OS_CODE  0x05
  180. #  ifdef TOSFS
  181. #    define NO_SYMLINK
  182. #    define NO_MULTIPLE_DOTS
  183. #    define MAX_EXT_CHARS 3
  184. #    define Z_SUFFIX "z"
  185. #    define NO_CHOWN
  186. #  endif
  187. #endif
  188.  
  189. #ifdef MACOS
  190. #  define PATH_SEP ':'
  191. #  define DYN_ALLOC
  192. #  define PROTO
  193. #  define NO_STDIN_FSTAT
  194. #  define NO_CHOWN
  195. #  define NO_UTIME
  196. #  define chmod(file, mode) (0)
  197. #  define OPEN(name, flags, mode) open(name, flags)
  198. #  define OS_CODE  0x07
  199. #  ifdef MPW
  200. #    define isatty(fd) ((fd) <= 2)
  201. #  endif
  202. #endif
  203.  
  204. #ifdef __50SERIES /* Prime/PRIMOS */
  205. #  define PATH_SEP '>'
  206. #  define STDC_HEADERS
  207. #  define NO_MEMORY_H
  208. #  define NO_UTIME_H
  209. #  define NO_UTIME
  210. #  define NO_CHOWN 
  211. #  define NO_STDIN_FSTAT 
  212. #  define NO_SIZE_CHECK 
  213. #  define NO_SYMLINK
  214. #  define RECORD_IO  1
  215. #  define casemap(c)  tolow(c) /* Force file names to lower case */
  216. #  define put_char(c) put_byte((c) & 0x7F)
  217. #  define get_char(c) ascii2pascii(get_byte())
  218. #  define OS_CODE  0x0F    /* temporary, subject to change */
  219. #  ifdef SIGTERM
  220. #    undef SIGTERM         /* We don't want a signal handler for SIGTERM */
  221. #  endif
  222. #endif
  223.  
  224. #ifdef WIN32
  225. #  define OS_CODE  0x0b
  226. #endif
  227.  
  228. #ifdef TOPS20
  229. #  define OS_CODE  0x0a
  230. #endif
  231.  
  232. #ifndef unix
  233. #  define NO_ST_INO /* don't rely on inode numbers */
  234. #endif
  235.  
  236. #if defined(ARCH)
  237. #  define MAX_PATH_LEN 256
  238. #  define OPTIONS_VAR "Gzip$Options"
  239. /* #  define PROTO */
  240. #  define PATH_SEP '.'
  241. #  define Z_SUFFIX "/gz"
  242. #endif
  243.  
  244.  
  245.     /* Common defaults */
  246.  
  247. #ifndef OS_CODE
  248. #  define OS_CODE  0x03  /* assume Unix */
  249. #endif
  250.  
  251. #ifndef PATH_SEP
  252. #  define PATH_SEP '/'
  253. #endif
  254.  
  255. #ifndef casemap
  256. #  define casemap(c) (c)
  257. #endif
  258.  
  259. #ifndef OPTIONS_VAR
  260. #  define OPTIONS_VAR "GZIP"
  261. #endif
  262.  
  263. #ifndef Z_SUFFIX
  264. #  define Z_SUFFIX ".gz"
  265. #endif
  266.  
  267. #ifdef MAX_EXT_CHARS
  268. #  define MAX_SUFFIX  MAX_EXT_CHARS
  269. #else
  270. #  define MAX_SUFFIX  30
  271. #endif
  272.  
  273. #ifndef MAKE_LEGAL_NAME
  274. #  ifdef NO_MULTIPLE_DOTS
  275. #    define MAKE_LEGAL_NAME(name)   make_simple_name(name)
  276. #  else
  277. #    define MAKE_LEGAL_NAME(name)
  278. #  endif
  279. #endif
  280.  
  281. #ifndef MIN_PART
  282. #  define MIN_PART 3
  283.    /* keep at least MIN_PART chars between dots in a file name. */
  284. #endif
  285.  
  286. #ifndef EXPAND
  287. #  define EXPAND(argc,argv)
  288. #endif
  289.  
  290. #ifndef RECORD_IO
  291. #  define RECORD_IO 0
  292. #endif
  293.  
  294. #ifndef SET_BINARY_MODE
  295. #  define SET_BINARY_MODE(fd)
  296. #endif
  297.  
  298. #ifndef OPEN
  299. #  define OPEN(name, flags, mode) open(name, flags, mode)
  300. #endif
  301.  
  302. #ifndef get_char
  303. #  define get_char() get_byte()
  304. #endif
  305.  
  306. #ifndef put_char
  307. #  define put_char(c) put_byte(c)
  308. #endif
  309.